# -*- coding: utf-8 -*-
"""
Created on Tue Oct 08 14:40:54 2013

@author: jkwong
"""

#PBAR_TestCargoImageStartBinFinder.py

import glob
import PBAR_Cargo

a = glob.glob(r'M:\common\John Kwong\PBAR-AutoZ\*.DR')

for (fileIndex, f) in enumerate(a):
    startBin = PBAR_Cargo.FindCargoStart(f)
    dat = PBAR_Cargo.ReadCargoImageDR(f)
    plt.figure()
    plt.imshow(dat.T, interpolation = 'nearest', aspect = 'auto')
    plt.ylim((100, 200))
    plt.xlim((80, 120))
    title(f + ', ' +  str(startBin))
    if fileIndex > 5:
        break